﻿
/*
*			抓取线程函数，抓取后进行压缩打包socket发送
*
*/


#pragma  once

#include <boost/signals2.hpp>
#include "CxThread.h"
#include "CxBuffer.h"
#include "CxPackageData.h"
#include "CxCapture.h"


namespace ImitateTansfer
{


	class CxGrabThread : public ImpCxThread
	{
		typedef boost::signals2::signal<void(double)>	_Signal;
	public:

		CxGrabThread (CxCapture *cap , CxWriteBuffer *buffer,size_t  portno);
		~CxGrabThread();
	public:

		_Signal				sig_framecount;


        void                SetFrame(double );

		bool				ChangeCapture(LPCSTR filename);

		bool	Begin(){return true;}
		bool	Close(){return true;}

		bool	Suspend(){return true;}
		bool	Continue(){return true;}
	protected:

		void				ThreadFunc();

	private:

		bool				m_spin;
		size_t				m_number;
		CxWriteBuffer		*m_buffer;
		CxCapture			*m_capture;
        boost::mutex        m_mu;
	};
}
